import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;




/**
 * @author Thiago Emmanuel Pereira da Cunha Silva, thiago.manel@gmail.com
 * @since 07/05/2006
 */
public class CompleteGoodTestP1{
	
	public static void main(String args[]) throws Exception{
		String filePath = args[0];
		System.out.println(read(filePath));
	}
	
	public static String read(String filePath) throws Exception{ 
		 StringBuffer xmlFinal = null;
	     BufferedReader textReader = null;

	         try {
				textReader = new BufferedReader(new InputStreamReader(new FileInputStream(
						 filePath), "UTF-8"));
				String inputLine;
		         while ((inputLine = textReader.readLine()) != null) {
		             if (null == xmlFinal) {
		                 xmlFinal = new StringBuffer(reverse(inputLine));
		             } else {
		                 xmlFinal.append("\n"+reverse(inputLine));
		             }	
		         }
			} catch (UnsupportedEncodingException e) {
				throw new UnsupportedEncodingException(e.getMessage());
			} catch (FileNotFoundException e) {
				throw new FileNotFoundException(e.getMessage());
			} catch (IOException e) {
				throw new IOException(e.getMessage());
			}
	     
	     return xmlFinal.toString();
	}
	
	public static String reverse(String string ) {
		StringBuffer buffer = new StringBuffer(string);
		String result = buffer.reverse().toString();
		return result;
	}
}